<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>登录页面</title>
<link rel="stylesheet" href="public/css/adminLogin.css" />
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>

	<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

	<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
	<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">

	<script
			async
			defer
			src="http://localhost:8080/api/application/embed?protocol=http&host=localhost:8080&token=3f333dcb1eb00b72">
	</script>
</head>
<body>

	<div style="background-image: linear-gradient(to right, #fbc2eb, #a6c1ee);height: 100%;">
		<div id="login" class="login-wrapper">
			<div class="header">Admin</div>
			<form method="post">
					<input type="text" name="username" class="input-item" placeholder="请输入账号" required="required">
					<input type="password" name="password" class="input-item" placeholder="请输入密码" required="required">
					<input type="submit" class="btn" value="登录" onclick="javascript:void(0);">
			</form>
		</div>

		<div style="position:fixed; top: 0; left: 0;">
			<a href="loginReader.html" target="_blank"><img src="public/image/用户.png" width="50px" height="50px"></a>
			<!--		切换登陆系统-->
			<br>
			<a href="loginManager.html" target="_blank"><img src="public/image/客户还款统计.png" width="50px" height="50px"></a>
		</div>
	</div>


	<script src="./public/js/layer/layer.js"></script>
	<script>
		$(function(){
			//登录	
			$("input[type=submit]").click(function(){
				
				$.ajax({
					url: "./adminLogin",
					type: "post",
					data: $("form").serialize(),
					dataType: "json",
					success: function( data ){
						if(data.code == 0){
							layer.msg("登录成功", {
								icon: 6,
								time: 1000
							}, function(){
								location.href = data.url;
							})
						}else{
							layer.open({
								title: "登录失败",
								content: data.msg,
								icon: 5,
								anim: 6
							})
						}
					}
				})
				return false;
			})
		})
	</script>
</body>
</html>